//  发布订阅模式

var salesOffices = {}

//订阅者队列
salesOffices.clientList = []

//订阅
salesOffices.listen = function(fn){
    this.clientList.push(fn)
}

//发布消息
salesOffices.trigger = function(){
    for(var i = 0, fn; fn = this.clientList[i++]; ){
        fn.apply(this,arguments)
    }
}
